Conversation
… the model description)
# Conflicts: # bundles/specmate-cause-effect-patterns/.classpath # bundles/specmate-integration-test/.classpath # bundles/specmate-integration-test/bnd.bnd # bundles/specmate-integration-test/resources/test_rules.objectif # bundles/specmate-model-generation/bnd.bnd # bundles/specmate-model-generation/generated/buildfiles # bundles/specmate-model-generation/src/com/specmate/modelgeneration/GenerateModelFromRequirementService.java # bundles/specmate-model-generation/src/com/specmate/modelgeneration/PatternbasedCEGGenerator.java # bundles/specmate-objectif/src/com/specmate/objectif/resolve/rule/ObjectifNode.java # bundles/specmate-std-env/dev-specmate-all.bndrun
junkerm
left a comment
There was a problem hiding this comment.
Not working for
WENN A ODER B
DANN
C
SONST
WENN
E ODER F
DANN
D
SONST
K
ENDE-WENN
ENDE-WENN
| private static String DE_Pattern = "\\b(der|die|das|ein|eine|einen)\\b"; | ||
|
|
||
| public static ELanguage detectLanguage(String text) { | ||
| if (text.matches(".*WENN.*ENDE-WENN.*")) { |
There was a problem hiding this comment.
the dot will not match line breaks, hence something like below is not detected. Solution: Use pattern=Pattern.compile(.*WENN.ENDE-WENN., Pattern.DOT_ALL)
pattern.matcher(text).matches()
WENN bla
DANN
blup
ENDE-WENN
There was a problem hiding this comment.
fixed in new commit
| @@ -1,4 +1,4 @@ | |||
| WENN A=5 UND B=3 DANN C=7 ENDE-WENN | |||
| WENN A=5 UND X=9 DANN C=7 ENDE-WENN | |||
There was a problem hiding this comment.
Possible to add multiline text to the test?
| try { | ||
| rules = new BusinessRuleUtil().parseXTextResource(text); | ||
| } catch (XTextException e) { | ||
| throw new SpecmateInternalException(ErrorCode.INTERNAL_PROBLEM, "..."); |
There was a problem hiding this comment.
please add a sensible exception message. something that indicates that the xtext pasrsing went wrong. also include the orginal message (e.getMessage())
There was a problem hiding this comment.
fixed in new commit
| @@ -1,4 +1,4 @@ | |||
| WENN A=5 UND B=3 DANN C=7 ENDE-WENN | |||
| WENN A=5 UND X=9 DANN C=7 ENDE-WENN | |||
There was a problem hiding this comment.
The model generation does not work when special chars (e.g. [(*<)) or umlauts (ÄÖÜ etc.) are in the text
The model generation does not work when line breaks are in the text (see comment below)
Pelase fix and add tests
|
Generally it seems that "SONST" is not correctly interpreted. I oculd not create a working example |
…unit test for xtext parsing
No description provided.